package chai.ning.immutable;

public class SmallMonkey extends Monkey {
	
	private int age ;

	public SmallMonkey( String name, char gender , int age ) {
		super(name, gender);
		this.age = age ;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}
	
	
	
	@Override
	public String toString() {
		return "SmallMonkey[( " + super.toString() + " ) , age=" + age + "]";
	}

	public static void main(String[] args) {
		
		SmallMonkey m = new SmallMonkey( "孙小圣" , '男' , 50 ); // SmallMonkey实例不是 【不可变对象】
		System.out.println( m );
		
		m.setAge( 100 ); // 修改实例变量的值
		System.out.println( m );
		
	}

}
